package cloud.provider.payment8001.controller;

import cloud.provider.payment8001.service.PaymentService;
import clould.springcloud.entity.CommontsResult;
import clould.springcloud.entity.Payment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/PaymentController")
public class PaymentController {
    @Autowired
    private CommontsResult commontsResult;
    @Autowired
    private PaymentService paymentService;

    @PostMapping("paymentInsert")
    public CommontsResult paymentInsert(@RequestBody Payment payment){
        return commontsResult.success(paymentService.paymentInsert(payment));
    }
}
